class Student(object):
    count = 0  # 初始计数为0
    def __init__(self, name):
        self.name = name     # 增加一个元素时，计数在原来的基础上+1
        Student.count += 1


stu1=Student('xiaogang')
stu2=Student('xiaobai')

print(Student.count)
